package com.rocky.ssm.service;

import com.rocky.ssm.mapper.StudentMapper;
import com.rocky.ssm.model.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Administrator on 2017/8/15.
 */

@Service
public class StudentService implements IStudent{

    @Autowired
    private StudentMapper studentMapper;

    @Override
    public Student getTalkById(int id) {
        return studentMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<Student> getStuList() {
        return studentMapper.selectStudentsList();
    }

    @Override
    public int save(Student student) {
        return studentMapper.insert(student);
    }

    @Override
    public int update(Student student) {
        return studentMapper.updateByPrimaryKey(student);
    }

    @Override
    public int delete(int id) {
        return studentMapper.deleteByPrimaryKey(id);
    }
}
